﻿using System;
using System.Collections;
using System.Linq;
using System.Text;

namespace Nauka.engine
{
    public class Hand
    {
        
        long gameNumber;
        long tableNumber;
        DateTime date;
        
        Card flop_card_1;
        Card flop_card_2;
        Card flop_card_3;
        Card turn_card;
        Card river_card;

        int button;
        float rake;
        int number_of_players;
        float big_blind;
        float small_blind;
        float pool;

        ArrayList game_players;
        ArrayList game_actions;

        public Hand()
        {

        }

        public Hand(long gameNumber, long tableNumber, DateTime date, Card f1, Card f2, Card f3, Card t, Card r, int button, float rake,
                    int num_of_players, float big_blind, float small_blind, float pool, ArrayList players, ArrayList actions){

            this.gameNumber = gameNumber;
            this.tableNumber = tableNumber;
            this.date = date;
            this.flop_card_1 = f1;
            this.flop_card_2 = f2;
            this.flop_card_3 = f3;
            this.turn_card = t;
            this.river_card = r;
            this.button = button;
            this.rake = rake;
            this.number_of_players = num_of_players;
            this.big_blind = big_blind;
            this.small_blind = small_blind;
            this.pool = pool;
            this.game_players = players;
            this.game_actions = actions;
        }

        public float getRake()
        {
            return this.rake;
        }

        public float getPool()
        {
            return this.pool;
        }

        public ArrayList getGamePlayers()
        {
            return game_players;
        }

        public ArrayList getActions()
        {
            return game_actions;
        }

        public int getNumOfPlayers()
        {
            return number_of_players;
        }

        public float getSB()
        {
            return small_blind;
        }

        public float getBB()
        {
            return big_blind;
        }

        public int getCard(int number)
        {
            try
            {
                switch (number)
                {
                    case 1:
                        return flop_card_1.intValue();
                    case 2:
                        return flop_card_2.intValue();
                    case 3:
                        return flop_card_3.intValue();
                    case 4:
                        return turn_card.intValue();
                    default:
                        return river_card.intValue();
                }
            }
            catch (NullReferenceException)
            {
                return 0;
            }

        }

        public int getButton()
        {
            return this.button;
        }


        public DateTime getDate(){
            return date;
        }

        public long getGameNr()
        {
            return gameNumber;
        }

        public long getTableID()
        {
            return tableNumber;
        }

    }
}
